DATAS SEGMENT  
    DAT DW 0,-1,1,123,2,23,34,24,234,13,3,4,5,6,9,7
    N EQU $-DAT
    RESULT DW N/2 DUP(?)
DATAS ENDS

CODES SEGMENT
    ASSUME CS:CODES,DS:DATAS
START:
	MOV AX,DATAS
    MOV DS,AX
    
    MOV CX,N
    LEA SI,DAT
    LEA DI,RESULT
LOP:
    MOV AL,[SI]
    MOV [DI],AL
    INC SI
    INC DI
    LOOP LOP
  
    MOV CX,N/2
    DEC CX
LOP1:
    MOV DI,CX
    MOV BX,0
LOP2:
    MOV AX,RESULT[BX]
    CMP AX,RESULT[BX+2]
    JLE CONTIMUE
    XCHG AX,RESULT[BX+2]
    MOV RESULT[BX],AX
CONTIMUE:
    ADD BX,2
    LOOP LOP2
    MOV CX,DI
    LOOP LOP1
    
    MOV AH,4CH   
    INT 21H
CODES ENDS
    END START